﻿Public Class NDepartamento

    Public Function buscardepartamento(ByVal texto As String) As DataTable

        Dim oDatos As New Datos.DDepartamentos
        Try
            Return oDatos.buscardepartamentos(texto)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function


    Public Function modificar(ByVal departamento As Entidades.EDepartamento) As Boolean
        Dim oDatos As New Datos.DDepartamentos
        Dim oDepartamento As New List(Of Entidades.EDepartamento)
        Dim band As Boolean
        Try
            band = oDatos.modificar(departamento)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function buscacoddepartamento(ByVal texto As String) As DataTable

        Dim oDatos As New Datos.DDepartamentos
        Try
            Return oDatos.buscacoddepartamentos(texto)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function guardardepartamentos(ByVal item As Entidades.EDepartamento) As Boolean
        Dim oDatos As New Datos.DDepartamentos
        Dim oDepartamento As New List(Of Entidades.EDepartamento)
        Dim band As Boolean
        Try
            band = oDatos.guardardepartamento(item)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function eliminardepartamento(ByVal item As Entidades.EDepartamento) As Boolean
        Dim oDatos As New Datos.DDepartamentos
        Dim oLocalidades As New List(Of Entidades.EDepartamento)
        Dim band As Boolean
        Try
            band = oDatos.eliminardep(item)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

End Class
